import { MockMethod } from 'vite-plugin-mock';

export default [
  {
    url: '/api/sys/token',
    method: 'post',
    response: () => {
      return {
        code: 200,
        message: '登录成功',
        data: {
          access_token: '@word(30)'
        }
      };
    }
  },
  {
    url: '/api/sys/menu/user',
    method: 'get',
    response: () => {
      return {
        code: 200,
        message: '查询成功',
        data: {
          userInfo: {
            nickName: '@cname',
            username: '@word(10)',
            imageUrl: '@image'
          },
          buttonList: [
            'system:menu:search',
            'system:menu:add',
            'system:child:add',
            'system:menu:edit',
            'system:menu:delete',
            'system:role:search',
            'system:role:add',
            'system:role:edit',
            'system:role:delete',
            'system:role:menu',
            'system:user:search',
            'system:user:add',
            'system:user:edit',
            'system:user:delete',
            'system:user:password'
          ],
          menuList: [
            {
              path: '/home',
              name: 'Home', // 路由名称
              redirect: null,
              component: 'home/index.vue', // 不要写 @/views/
              meta: {
                title: '工作台',
                icon: 'solar:home-broken',
                cache: true,
                hidden: false
              },
              children: []
            },
            {
              path: '/system',
              name: 'System',
              redirect: '/system/menu',
              meta: {
                title: '系统管理',
                icon: 'grommet-icons:system',
                cache: true,
                parent: "System",
                hidden: false
              },
              children: [
                {
                  path: '/system/user',
                  name: 'SystemUser',
                  redirect: null,
                  component: 'system/user/index.vue',
                  meta: {
                    title: '用户管理',
                    icon: 'ele-User',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/system/menu',
                  name: 'SystemMenu',
                  redirect: null,
                  component: 'system/menu/index.vue',
                  meta: {
                    title: '菜单管理',
                    icon: 'ele-Menu',
                    cache: false,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/system/company',
                  name: 'SystemCompany',
                  redirect: null,
                  component: 'system/company/index.vue',
                  meta: {
                    title: '组织管理',
                    icon: 'ele-User',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/system/role',
                  name: 'SystemRole',
                  component: 'system/role/index.vue',
                  meta: {
                    title: '角色管理',
                    icon: 'ele-IceCream',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
              
                {
                  path: '/system/dict',
                  name: 'SystemDict',
                  redirect: null,
                  component: 'system/dict/index.vue',
                  meta: {
                    title: '字典管理',
                    icon: 'ele-User',
                    cache: true,
                    hidden: false
                  },
                  children: []
                }
              ]
            },
            {
              path: '/feature',
              name: 'Feature',
              redirect: '/feature/auth',
              meta: {
                title: '功能示例',
                icon: 'carbon:flow-data',
                cache: true,
                parent: "Feature",
                hidden: false
              },
              children: [
                {
                  path: '/feature/auth',
                  name: 'FeatureAuth',
                  redirect: null,
                  component: 'feature/auth/index.vue',
                  meta: {
                    title: '按钮权限',
                    icon: 'ele-User',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/feature/role',
                  name: 'FeatureRole',
                  redirect: null,
                  component: 'feature/role/index.vue',
                  meta: {
                    title: '角色权限',
                    icon: 'ele-User',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/feature/elements',
                  name: 'FeatureElements',
                  redirect: null,
                  component: 'feature/elements/index.vue',
                  meta: {
                    title: '元素功能',
                    icon: '',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/feature/browser',
                  name: 'FeatureBrowser',
                  redirect: null,
                  component: 'feature/browser/index.vue',
                  meta: {
                    title: '浏览器',
                    icon: '',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
                {
                  path: '/feature/undo',
                  name: 'FeatureUndo',
                  redirect: null,
                  component: 'feature/undo/index.vue',
                  meta: {
                    title: '撤销/重做',
                    icon: '',
                    cache: true,
                    hidden: false
                  },
                  children: []
                },
              ]
            },
            {
              path: '/dataV',
              name: 'DataV',
              redirect: '/dataV/visualList',
              meta: {
                title: '大屏管理',
                icon: 'grommet-icons:system',
                cache: true,
                parent: "DataV",
                hidden: false
              },
              children: [
                {
                  path: '/dataV/visualList',
                  name: 'dataVList',
                  redirect: null,
                  component: 'dataV/visualList/index.vue',
                  meta: {
                    title: '可视化管理',
                    cache: false,
                    hidden: false
                  },
                  children: []
                }
              ]
            },
            {
              path: '/link',
              name: 'Link', // 路由名称
              redirect: null,
              component: 'link/index.vue',
              meta: {
                title: '云涵官网',
                icon: 'akar-icons:link',
                linkTo: 'https://www.baidu.com', // 外链跳转地址
                cache: true,
                hidden: false
              },
              children: []
            },
          ]
        }
      };
    }
  },
  {

    url: '/api/sys/auth/logout',
    method: 'post',
    response: () => {
      return {
        code: 200,
        message: '退出成功',
        data: true
      };
    }
  }
] as MockMethod[];
